//
//  AppConstant.swift
//  AnneKit-Swift
//
//  Created by 宁小陌 on 2021/2/2.
//  Copyright © 2021 宁小陌. All rights reserved.
//

import UIKit


let kScreenBounds   :CGRect  = UIScreen.main.bounds
let kScreenWidth    :CGFloat = UIScreen.main.bounds.width
let kScreenHeight   :CGFloat = UIScreen.main.bounds.height
let kScreenScale    :CGFloat = UIScreen.main.scale
/*! 状态栏的高  */
let kStatusBarHeight:CGFloat = UIApplication.shared.statusBarFrame.height
/// 比例
let kScaleWidth     :CGFloat = kScreenWidth / 375.0
let kScaleHeight    :CGFloat = kScreenHeight / 667.0
let kScalerratio    :CGFloat = kScreenWidth > 1 ? kScreenWidth : 1
let kTabBarHeight   :CGFloat = (isIphoneX() ? 83 : 49)
let kNavBarHeight   :CGFloat = (isIphoneX() ? kStatusBarHeight + 44 : 64)



//NXMUILog(parameter: UIDevice.topSafeAreaHeight)
//NXMUILog(parameter: UIDevice.bottomSafeAreaHeight)
//NXMUILog(parameter: UIDevice.navigationBarHeight)
//NXMUILog(parameter: UIDevice.tabBarHeight)



//        [NXMMineViewController.swift > viewDidLoad() > line:22] - :44.0
//        [NXMMineViewController.swift > viewDidLoad() > line:25] - :isIphoneX
//        [NXMMineViewController.swift > viewDidLoad() > line:46] - :wode
//        [NXMMineViewController.swift > viewDidLoad() > line:51] - :44.0
//        [NXMMineViewController.swift > viewDidLoad() > line:52] - :34.0
//        [NXMMineViewController.swift > viewDidLoad() > line:53] - :88.0
//        [NXMMineViewController.swift > viewDidLoad() > line:54] - :83.0
//
//
//        [NXMMineViewController.swift > viewDidLoad() > line:22] - :47.0
//        [NXMMineViewController.swift > viewDidLoad() > line:25] - :isIphoneX
//        [NXMMineViewController.swift > viewDidLoad() > line:46] - :wode
//        [NXMMineViewController.swift > viewDidLoad() > line:51] - :47.0
//        [NXMMineViewController.swift > viewDidLoad() > line:52] - :34.0
//        [NXMMineViewController.swift > viewDidLoad() > line:53] - :91.0
//        [NXMMineViewController.swift > viewDidLoad() > line:54] - :83.0


//        [NXMMineViewController.swift > viewDidLoad() > line:22] - :20.0
//        [NXMMineViewController.swift > viewDidLoad() > line:27] - :isIphoneX个锤子
//        [NXMMineViewController.swift > viewDidLoad() > line:46] - :wode
//        [NXMMineViewController.swift > viewDidLoad() > line:51] - :20.0
//        [NXMMineViewController.swift > viewDidLoad() > line:52] - :0.0
//        [NXMMineViewController.swift > viewDidLoad() > line:53] - :64.0
//        [NXMMineViewController.swift > viewDidLoad() > line:54] - :49.0


let isIphone = (UI_USER_INTERFACE_IDIOM()==UIDevice.current.userInterfaceIdiom)
/* 判断是否是带刘海 */
func isIphoneX() -> Bool {
   if #available(iOS 11.0, *) {
       let window = UIApplication.shared.delegate?.window
       guard (window != nil) else { return false }
       let heigth: CGFloat = window!!.safeAreaInsets.bottom
       if heigth > 0 {
           return true
       }
   }
   return false
}

let kTimeIntervalRequest = TimeInterval(20)
let kTimeIntervalAnimation = TimeInterval(0.25)
let kTimeIntervalAnimationFast = TimeInterval(0.15)

/** 刘海高 **/
var BLBangHeight: CGFloat {
    if #available(iOS 11.0, *) {
        return (UIApplication.shared.keyWindow?.safeAreaInsets.top)!
    } else {
        return 0
    }
}

/*!
 打印内容，并包含类名和打印所在行数
 - Parameters:  泛型，打印对象
 - file: 打印所属类
 - lineNumber: 打印语句所在行数
 */
func NXMUILog<parameter>(parameter : parameter, file : String = #file,method: String = #function, lineNumber : Int = #line){
    #if DEBUG
    let fileName = (file as NSString).lastPathComponent
    print("[\(fileName) > \(method) > line:\(lineNumber)] - :\(parameter)")
    #endif
}
